import { config } from "@/managers/ConfigManager.js";
import { SceneManager } from "@/managers/SceneManager.js";
import { StorageManager } from "@/managers/StorageManager";
import { Scene_Base } from "@/scenes/Scene_Base.js";
import { Window_StoreFiles } from "@/windows/Window_StoreFiles.js";

export class Scene_StoreFile extends Scene_Base{
    constructor(){
        super();
    }

    create(){
        super.create();
        this.createStoreWindow();

        this.attachHnadler();
    }

    createStoreWindow(){
        this._storeWindow=new Window_StoreFiles(config.width,config.height);
        this.addChild(this._storeWindow);
    }

    attachHnadler(){
        this._storeWindow.setHandler('cancel',()=>{
            SceneManager.pop();
        })
    }

    start(){
        super.start();
        this._storeWindow.setGlobInfo(StorageManager.load(0));
    }
}